Optimal. Leaf size=186 \[ -\frac {2 d^2 \text {Li}_3\left (-i e^{i (a+b x)}\right )}{b^3}+\frac {2 d^2 \text {Li}_3\left (i e^{i (a+b x)}\right )}{b^3}+\frac {2 d^2 \sin (a+b x)}{b^3}+\frac {2 i d (c+d x) \text {Li}_2\left (-i e^{i (a+b x)}\right )}{b^2}-\frac {2 i d (c+d x) \text {Li}_2\left (i e^{i (a+b x)}\right )}{b^2}-\frac {2 d (c+d x) \cos (a+b x)}{b^2}-\frac {(c+d x)^2 \sin (a+b x)}{b}-\frac {2 i (c+d x)^2 \tan ^{-1}\left (e^{i (a+b x)}\right )}{b} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.15, antiderivative size = 186, normalized size of antiderivative = 1.00, number of steps used = 11, number of rules used = 7, integrand size = 20, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.350, Rules used = {4407, 3296, 2637, 4181, 2531, 2282, 6589} \[ \frac {2 i d (c+d x) \text {PolyLog}\left (2,-i e^{i (a+b x)}\right )}{b^2}-\frac {2 i d (c+d x) \text {PolyLog}\left (2,i e^{i (a+b x)}\right )}{b^2}-\frac {2 d^2 \text {PolyLog}\left (3,-i e^{i (a+b x)}\right )}{b^3}+\frac {2 d^2 \text {PolyLog}\left (3,i e^{i (a+b x)}\right )}{b^3}-\frac {2 d (c+d x) \cos (a+b x)}{b^2}+\frac {2 d^2 \sin (a+b x)}{b^3}-\frac {(c+d x)^2 \sin (a+b x)}{b}-\frac {2 i (c+d x)^2 \tan ^{-1}\left (e^{i (a+b x)}\right )}{b} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 2282
Rule 2531
Rule 2637
Rule 3296
Rule 4181
Rule 4407
Rule 6589
Rubi steps
\begin {align*} \int (c+d x)^2 \sin (a+b x) \tan (a+b x) \, dx &=-\int (c+d x)^2 \cos (a+b x) \, dx+\int (c+d x)^2 \sec (a+b x) \, dx\\ &=-\frac {2 i (c+d x)^2 \tan ^{-1}\left (e^{i (a+b x)}\right )}{b}-\frac {(c+d x)^2 \sin (a+b x)}{b}-\frac {(2 d) \int (c+d x) \log \left (1-i e^{i (a+b x)}\right ) \, dx}{b}+\frac {(2 d) \int (c+d x) \log \left (1+i e^{i (a+b x)}\right ) \, dx}{b}+\frac {(2 d) \int (c+d x) \sin (a+b x) \, dx}{b}\\ &=-\frac {2 i (c+d x)^2 \tan ^{-1}\left (e^{i (a+b x)}\right )}{b}-\frac {2 d (c+d x) \cos (a+b x)}{b^2}+\frac {2 i d (c+d x) \text {Li}_2\left (-i e^{i (a+b x)}\right )}{b^2}-\frac {2 i d (c+d x) \text {Li}_2\left (i e^{i (a+b x)}\right )}{b^2}-\frac {(c+d x)^2 \sin (a+b x)}{b}-\frac {\left (2 i d^2\right ) \int \text {Li}_2\left (-i e^{i (a+b x)}\right ) \, dx}{b^2}+\frac {\left (2 i d^2\right ) \int \text {Li}_2\left (i e^{i (a+b x)}\right ) \, dx}{b^2}+\frac {\left (2 d^2\right ) \int \cos (a+b x) \, dx}{b^2}\\ &=-\frac {2 i (c+d x)^2 \tan ^{-1}\left (e^{i (a+b x)}\right )}{b}-\frac {2 d (c+d x) \cos (a+b x)}{b^2}+\frac {2 i d (c+d x) \text {Li}_2\left (-i e^{i (a+b x)}\right )}{b^2}-\frac {2 i d (c+d x) \text {Li}_2\left (i e^{i (a+b x)}\right )}{b^2}+\frac {2 d^2 \sin (a+b x)}{b^3}-\frac {(c+d x)^2 \sin (a+b x)}{b}-\frac {\left (2 d^2\right ) \operatorname {Subst}\left (\int \frac {\text {Li}_2(-i x)}{x} \, dx,x,e^{i (a+b x)}\right )}{b^3}+\frac {\left (2 d^2\right ) \operatorname {Subst}\left (\int \frac {\text {Li}_2(i x)}{x} \, dx,x,e^{i (a+b x)}\right )}{b^3}\\ &=-\frac {2 i (c+d x)^2 \tan ^{-1}\left (e^{i (a+b x)}\right )}{b}-\frac {2 d (c+d x) \cos (a+b x)}{b^2}+\frac {2 i d (c+d x) \text {Li}_2\left (-i e^{i (a+b x)}\right )}{b^2}-\frac {2 i d (c+d x) \text {Li}_2\left (i e^{i (a+b x)}\right )}{b^2}-\frac {2 d^2 \text {Li}_3\left (-i e^{i (a+b x)}\right )}{b^3}+\frac {2 d^2 \text {Li}_3\left (i e^{i (a+b x)}\right )}{b^3}+\frac {2 d^2 \sin (a+b x)}{b^3}-\frac {(c+d x)^2 \sin (a+b x)}{b}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.83, size = 315, normalized size = 1.69 \[ -\frac {b^2 c^2 \sin (a+b x)+2 i b^2 c^2 \tan ^{-1}\left (e^{i (a+b x)}\right )-2 b^2 c d x \log \left (1-i e^{i (a+b x)}\right )+2 b^2 c d x \log \left (1+i e^{i (a+b x)}\right )+2 b^2 c d x \sin (a+b x)-b^2 d^2 x^2 \log \left (1-i e^{i (a+b x)}\right )+b^2 d^2 x^2 \log \left (1+i e^{i (a+b x)}\right )+b^2 d^2 x^2 \sin (a+b x)-2 i b d (c+d x) \text {Li}_2\left (-i e^{i (a+b x)}\right )+2 i b d (c+d x) \text {Li}_2\left (i e^{i (a+b x)}\right )+2 b c d \cos (a+b x)+2 d^2 \text {Li}_3\left (-i e^{i (a+b x)}\right )-2 d^2 \text {Li}_3\left (i e^{i (a+b x)}\right )-2 d^2 \sin (a+b x)+2 b d^2 x \cos (a+b x)}{b^3} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [C] time = 0.52, size = 656, normalized size = 3.53 \[ -\frac {2 \, d^{2} {\rm polylog}\left (3, i \, \cos \left (b x + a\right ) + \sin \left (b x + a\right )\right ) - 2 \, d^{2} {\rm polylog}\left (3, i \, \cos \left (b x + a\right ) - \sin \left (b x + a\right )\right ) + 2 \, d^{2} {\rm polylog}\left (3, -i \, \cos \left (b x + a\right ) + \sin \left (b x + a\right )\right ) - 2 \, d^{2} {\rm polylog}\left (3, -i \, \cos \left (b x + a\right ) - \sin \left (b x + a\right )\right ) + 4 \, {\left (b d^{2} x + b c d\right )} \cos \left (b x + a\right ) - {\left (-2 i \, b d^{2} x - 2 i \, b c d\right )} {\rm Li}_2\left (i \, \cos \left (b x + a\right ) + \sin \left (b x + a\right )\right ) - {\left (-2 i \, b d^{2} x - 2 i \, b c d\right )} {\rm Li}_2\left (i \, \cos \left (b x + a\right ) - \sin \left (b x + a\right )\right ) - {\left (2 i \, b d^{2} x + 2 i \, b c d\right )} {\rm Li}_2\left (-i \, \cos \left (b x + a\right ) + \sin \left (b x + a\right )\right ) - {\left (2 i \, b d^{2} x + 2 i \, b c d\right )} {\rm Li}_2\left (-i \, \cos \left (b x + a\right ) - \sin \left (b x + a\right )\right ) - {\left (b^{2} c^{2} - 2 \, a b c d + a^{2} d^{2}\right )} \log \left (\cos \left (b x + a\right ) + i \, \sin \left (b x + a\right ) + i\right ) + {\left (b^{2} c^{2} - 2 \, a b c d + a^{2} d^{2}\right )} \log \left (\cos \left (b x + a\right ) - i \, \sin \left (b x + a\right ) + i\right ) - {\left (b^{2} d^{2} x^{2} + 2 \, b^{2} c d x + 2 \, a b c d - a^{2} d^{2}\right )} \log \left (i \, \cos \left (b x + a\right ) + \sin \left (b x + a\right ) + 1\right ) + {\left (b^{2} d^{2} x^{2} + 2 \, b^{2} c d x + 2 \, a b c d - a^{2} d^{2}\right )} \log \left (i \, \cos \left (b x + a\right ) - \sin \left (b x + a\right ) + 1\right ) - {\left (b^{2} d^{2} x^{2} + 2 \, b^{2} c d x + 2 \, a b c d - a^{2} d^{2}\right )} \log \left (-i \, \cos \left (b x + a\right ) + \sin \left (b x + a\right ) + 1\right ) + {\left (b^{2} d^{2} x^{2} + 2 \, b^{2} c d x + 2 \, a b c d - a^{2} d^{2}\right )} \log \left (-i \, \cos \left (b x + a\right ) - \sin \left (b x + a\right ) + 1\right ) - {\left (b^{2} c^{2} - 2 \, a b c d + a^{2} d^{2}\right )} \log \left (-\cos \left (b x + a\right ) + i \, \sin \left (b x + a\right ) + i\right ) + {\left (b^{2} c^{2} - 2 \, a b c d + a^{2} d^{2}\right )} \log \left (-\cos \left (b x + a\right ) - i \, \sin \left (b x + a\right ) + i\right ) + 2 \, {\left (b^{2} d^{2} x^{2} + 2 \, b^{2} c d x + b^{2} c^{2} - 2 \, d^{2}\right )} \sin \left (b x + a\right )}{2 \, b^{3}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int {\left (d x + c\right )}^{2} \sec \left (b x + a\right ) \sin \left (b x + a\right )^{2}\,{d x} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [B] time = 0.26, size = 512, normalized size = 2.75 \[ \frac {i \left (d^{2} x^{2} b^{2}+2 b^{2} c d x +2 i b \,d^{2} x +b^{2} c^{2}+2 i b c d -2 d^{2}\right ) {\mathrm e}^{i \left (b x +a \right )}}{2 b^{3}}+\frac {4 i c d a \arctan \left ({\mathrm e}^{i \left (b x +a \right )}\right )}{b^{2}}-\frac {2 c d \ln \left (1+i {\mathrm e}^{i \left (b x +a \right )}\right ) x}{b}-\frac {2 d^{2} \polylog \left (3, -i {\mathrm e}^{i \left (b x +a \right )}\right )}{b^{3}}-\frac {i \left (d^{2} x^{2} b^{2}+2 b^{2} c d x -2 i b \,d^{2} x +b^{2} c^{2}-2 i b c d -2 d^{2}\right ) {\mathrm e}^{-i \left (b x +a \right )}}{2 b^{3}}-\frac {2 i c^{2} \arctan \left ({\mathrm e}^{i \left (b x +a \right )}\right )}{b}-\frac {2 i c d \polylog \left (2, i {\mathrm e}^{i \left (b x +a \right )}\right )}{b^{2}}-\frac {d^{2} \ln \left (1+i {\mathrm e}^{i \left (b x +a \right )}\right ) x^{2}}{b}+\frac {2 d^{2} \polylog \left (3, i {\mathrm e}^{i \left (b x +a \right )}\right )}{b^{3}}-\frac {2 i d^{2} \polylog \left (2, i {\mathrm e}^{i \left (b x +a \right )}\right ) x}{b^{2}}+\frac {2 c d \ln \left (1-i {\mathrm e}^{i \left (b x +a \right )}\right ) a}{b^{2}}+\frac {2 c d \ln \left (1-i {\mathrm e}^{i \left (b x +a \right )}\right ) x}{b}+\frac {2 i d^{2} \polylog \left (2, -i {\mathrm e}^{i \left (b x +a \right )}\right ) x}{b^{2}}-\frac {2 c d \ln \left (1+i {\mathrm e}^{i \left (b x +a \right )}\right ) a}{b^{2}}+\frac {a^{2} d^{2} \ln \left (1+i {\mathrm e}^{i \left (b x +a \right )}\right )}{b^{3}}-\frac {2 i d^{2} a^{2} \arctan \left ({\mathrm e}^{i \left (b x +a \right )}\right )}{b^{3}}+\frac {2 i c d \polylog \left (2, -i {\mathrm e}^{i \left (b x +a \right )}\right )}{b^{2}}+\frac {d^{2} \ln \left (1-i {\mathrm e}^{i \left (b x +a \right )}\right ) x^{2}}{b}-\frac {a^{2} d^{2} \ln \left (1-i {\mathrm e}^{i \left (b x +a \right )}\right )}{b^{3}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [B] time = 0.60, size = 510, normalized size = 2.74 \[ \frac {c^{2} {\left (\log \left (\sin \left (b x + a\right ) + 1\right ) - \log \left (\sin \left (b x + a\right ) - 1\right ) - 2 \, \sin \left (b x + a\right )\right )} - \frac {2 \, a c d {\left (\log \left (\sin \left (b x + a\right ) + 1\right ) - \log \left (\sin \left (b x + a\right ) - 1\right ) - 2 \, \sin \left (b x + a\right )\right )}}{b} + \frac {a^{2} d^{2} {\left (\log \left (\sin \left (b x + a\right ) + 1\right ) - \log \left (\sin \left (b x + a\right ) - 1\right ) - 2 \, \sin \left (b x + a\right )\right )}}{b^{2}} + \frac {4 \, d^{2} {\rm Li}_{3}(i \, e^{\left (i \, b x + i \, a\right )}) - 4 \, d^{2} {\rm Li}_{3}(-i \, e^{\left (i \, b x + i \, a\right )}) + {\left (-2 i \, {\left (b x + a\right )}^{2} d^{2} + {\left (-4 i \, b c d + 4 i \, a d^{2}\right )} {\left (b x + a\right )}\right )} \arctan \left (\cos \left (b x + a\right ), \sin \left (b x + a\right ) + 1\right ) + {\left (-2 i \, {\left (b x + a\right )}^{2} d^{2} + {\left (-4 i \, b c d + 4 i \, a d^{2}\right )} {\left (b x + a\right )}\right )} \arctan \left (\cos \left (b x + a\right ), -\sin \left (b x + a\right ) + 1\right ) - 4 \, {\left (b c d + {\left (b x + a\right )} d^{2} - a d^{2}\right )} \cos \left (b x + a\right ) + {\left (-4 i \, b c d - 4 i \, {\left (b x + a\right )} d^{2} + 4 i \, a d^{2}\right )} {\rm Li}_2\left (i \, e^{\left (i \, b x + i \, a\right )}\right ) + {\left (4 i \, b c d + 4 i \, {\left (b x + a\right )} d^{2} - 4 i \, a d^{2}\right )} {\rm Li}_2\left (-i \, e^{\left (i \, b x + i \, a\right )}\right ) + {\left ({\left (b x + a\right )}^{2} d^{2} + 2 \, {\left (b c d - a d^{2}\right )} {\left (b x + a\right )}\right )} \log \left (\cos \left (b x + a\right )^{2} + \sin \left (b x + a\right )^{2} + 2 \, \sin \left (b x + a\right ) + 1\right ) - {\left ({\left (b x + a\right )}^{2} d^{2} + 2 \, {\left (b c d - a d^{2}\right )} {\left (b x + a\right )}\right )} \log \left (\cos \left (b x + a\right )^{2} + \sin \left (b x + a\right )^{2} - 2 \, \sin \left (b x + a\right ) + 1\right ) - 2 \, {\left ({\left (b x + a\right )}^{2} d^{2} + 2 \, {\left (b c d - a d^{2}\right )} {\left (b x + a\right )} - 2 \, d^{2}\right )} \sin \left (b x + a\right )}{b^{2}}}{2 \, b} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [F] time = 0.00, size = -1, normalized size = -0.01 \[ \int \frac {{\sin \left (a+b\,x\right )}^2\,{\left (c+d\,x\right )}^2}{\cos \left (a+b\,x\right )} \,d x \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int \left (c + d x\right )^{2} \sin ^{2}{\left (a + b x \right )} \sec {\left (a + b x \right )}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________